package com.dongdong.fallback;

import com.dongdong.api.SellerAPI;
import com.dongdong.model.TbSeller;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

@Slf4j
public class SellerFallBack implements FallbackFactory<SellerAPI> {

    @Override
    public SellerAPI create(Throwable cause) {
        return new SellerAPI() {
            @Override
            public TbSeller getSellerByName(String username) {
                log.error("失败编写降级逻辑", cause);
                return new TbSeller();
            }
        };
    }
}

